<style>
.nav {
  height: 25px;
}
.nav a {
  color: #000; 
  font-weight: bold; 
  font-size: 13px;
}
.arrow {
  width: 20px;
  text-align: center;
  color: #aaa;
}
.last {
  height: 25px;
  color: #333; 
  font-size: 13px;
}
</style>
<?php 
$id = MiscUtils::getParam('i', NULL);

$mRoot2 = new stdClass();
$mRoot2->id = 0;
$mRoot2->name = 'ROOT';
$mRoot2->link = '';
$mRoot2->c = array();
_createMenuRoot2($pages, $mRoot2);

$nav = _getNav($mRoot2, $id);

if (count($nav) >= 1) {
  $id = $nav[0]->id;
  if (count($nav) == 1) {
    $nav = array();
  }
}

?>

<?php if (count($nav) == 0) { ?>
<div id="real_last" style="display: none;border-bottom: 1px solid #aaa; padding: 0 0 4px 15px; background-image: url(exts/uis/<?php echo $path; ?>/assets/imgs/by.png); text-align: left;">
  <table cellPadding="0" cellSpacing="0" style="<?php echo ((count($nav) == 0) ? 'padding: 0 0 0 0' : ''); ?>">
    <tr>
      <td><span style="height: 10px;" id="<?php echo LAST_NAV; ?>"></span></td>
    </tr>
  </table>
</div>
<div>&nbsp;</div>
<?php } else { ?>
<div style="border-bottom: 1px solid #aaa; padding: 0 0 4px 15px; background-image: url(exts/uis/<?php echo $path; ?>/assets/imgs/by.png); text-align: left;">
  <table cellPadding="0" cellSpacing="0" style="<?php echo ((count($nav) > 0) ? 'padding: 0 0 0 0' : ''); ?>">
    <tr>
    <?php
    foreach ($nav as $idx => &$n) {
      if ($idx == 0) {
        echo "<td class=\"nav\"><a href=\"#\">" . $n->name  . "</a><td class=\"arrow\">></td>";
      } else if ($idx != (count($nav) - 1)) {
        echo "<td class=\"nav\"><a href=\"$n->link\">" . $n->name  . "</a><td class=\"arrow\">></td>";
      } else {
        echo "<td class=\"last\">" . $n->name  . "<span id=\"" . LAST_NAV . "\" style=\"margin-left: 5px\"></span></td>";
      }
    }
    ?>
    </tr>
  </table>
</div>
<div>&nbsp;</div>
<?php } ?>
